<template>
	<view class="row">
		<view class="left">
			<uni-icons :type="icon" size="20"></uni-icons>
			<view class="text">{{text}}</view>
		</view>
		<view class="right">
			<view class="count">{{count}}</view>
			<uni-icons type="right" size="15" color="#aaa"></uni-icons>
		</view>
		<!-- #ifdef MP-WEIXIN -->
		<button v-if="isShow" class="btn" open-type="contact">联系客服</button>
		<!-- #endif -->

		<!-- #ifndef MP-WEIXIN -->
		<button v-if="isShow" class="btn" @click="onClick">拨打电话</button>
		<!-- #endif -->
	</view>
</template>

<script setup>
	defineOptions({
	  options: { styleIsolation: 'shared' }  // 关闭微信小程序样式隔离 ‌关键配置 ‌:ml-citation{ref="1,6" data="citationList"}
	})
	defineProps({
		icon:{
			type:String,
			default:"download-filled"
		},
		text:{
			type:String,
			default:"我的下载"
		},
		count:{
			type:Number
		},
		isShow:{
			type: Boolean,
			default: false
		}
	})
	
	const onClick = () => {
		uni.makePhoneCall({
			phoneNumber:"19904417420"
		})
	}
</script>

<style lang="scss" scoped>
	.row{
		position: relative;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 30rpx;
		border-bottom: 1px solid #eee;
		height: 100rpx;
		.btn{
			position: absolute;
			left: 0;
			width: 100%;
			height: 100rpx;
			opacity: 0;
		}
		&:last-child{
			border-bottom: 0;
		}
		.left{
			display: flex;
			align-items: center;
			.text{
				padding-left: 20rpx;
				color: #666;
			}
			:deep(){
				.uni-icons{
					color: $brand-theme-color !important;
				}
			}
		}
		.right{
			display: flex;
			align-items: center;
			.count{
				font-size: 28rpx;
				color: #aaa;
				margin-right: 4rpx;
				line-height: 28rpx;
			}
		}
	}
</style>